
<div class="tipbox tipbox-message mb10">
    友情提示:如设置了推荐,请上传一个宽600高240的的引导图片
</div>
<form id="form" action="{:url('ask/edit')}">
<input type="hidden" name="id" value="{$info.id}"/>
<input type="hidden" id="ad_img" name="ad_img" value="{$info.ad_img}"/>
    <table class="formtable">
        <tr>
            <th>问题类型:</th>
            <td>
                <label>是否推荐：</label>
                <select class="select w100" name="is_ad" class="select">
                    <option value="0"{$info.is_ad == 0 ? ' selected':''}>普通</option>
                    <option value="1"{$info.is_ad == 1 ? ' selected':''}>推荐</option>
                </select>
                <label>是否置顶：</label>
                <select class="select w100" name="is_top" class="select">
                    <option value="0"{$info.is_top == 0 ? ' selected':''}>普通</option>
                    <option value="1"{$info.is_top == 1 ? ' selected':''}>置顶</option>
                </select>
            </td>
        </tr>
        <tr><th>引导图片</th><td id="imgbox">
            <div class="box-view {$info.is_ad ?'w500':''}"><div class="img">{if $info.ad_img}<img  src="{$info.ad_img}" />{/if}</div><div class="opera">宽600px/高240px</div></div>
        </td></tr>
        <tr>
            <th>问题分类:</th>
            <td>
                <select class="select w500" name="category_id" class="select">
                    {foreach $category as $rs}<option value="{$rs.id}"{$info.category_id == $rs.id ? ' selected':''}>{$rs.title}</option>{/foreach}
                </select>
            </td>
        </tr>
        <tr><th>问题名称:</th><td><input class="input w500" datatype="*" type="text" name="title" value="{$info.title}" /></td></tr>
        <tr><th>问题简述:</th><td><textarea class="textarea h80 w500" datatype="*" type="text" name="note">{$info.note}</textarea></td></tr>
        <tr><th>问题详情:</th><td><textarea class="textarea ui-editor" name="content">{$info.content|dehtml}</textarea></td></tr>
        <tr><th>问题价格:</th><td><input class="input w80" datatype="*" type="text" name="price" value="{$info.price}" /> <span class="gray">需要支付费用才允许查看解决方案</span></td></tr>
        <tr><th>解决方案:</th><td><textarea class="textarea ui-editor" name="answer">{$info.answer|dehtml}</textarea></td></tr>
        <tr>
            <th></th>
            <td>
                <input type="submit" value="确定" class="button button-blue submit" />
                <input type="reset" value="重置" class="button button-blank"/>
            </td>
        </tr>
    </table>
</form>
<script type="text/javascript">
Do('base','layer','editor','form',function(){
    $('#form').isForm({'upload':'{:url("system/passport.common/upload")}'});
    $(".box-view").click(function(){openwin('{:url("system/passport.common/upload")}')});
    $('select[name=is_ad]').change(function(){
        var id =  $("select[name=is_ad] option:checked").val();
        1 == id ? $(".box-view").addClass('w500'):$(".box-view").removeClass('w500');
    });
})
//添加图片
function setImg(show_src){
    $("#ad_img").val(show_src);
    $(".box-view").html('<img src="'+show_src+'">');  
}
</script>